package com.sunfeng.n3;


import java.util.concurrent.locks.LockSupport;

public class Test22 {
    public static void main(String[] args) throws InterruptedException {
            LockSupport.unpark(Thread.currentThread());

        Thread thread = new Thread(() -> {
        }, "t2");

        thread.start();
        //当子线程threadA执行完毕的时候，jvm会自动唤醒阻塞在threadA对象上的线程，在我们的例子中也就是主线程。至此，threadA线程对象被notifyall了，那么主线程也就能继续跑下去了。
        thread.join();

    }
}
